<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
cfc('core')->checklogin('jy_jdpm/member.index/');
$return=array();
$nickname=pdo_getcolumn('jy_jdpm_member',array('mid'=>$_SESSION['uid']),'nickname');
$return['nickname']=$nickname;
$return['channel'] = pdo_getall('jy_jdpm_goods_group',array('pid' => 0),'','','paixu asc');
$sid    = intval($_RQ['id']);
$uid    = $_SESSION['uid'];
        // 设置已读
		pdo_update('jy_jdpm_mysms',array('status' => 1),array('uniacid'=>$_SESSION['uniacid'],'mid' => $uid , 'id' => $sid));
        // 消息以及商品关联信息
		$info = pdo_get('jy_jdpm_mysms',array('mid' => $uid , 'id' => $sid));
		$info['content'] = preg_replace("/<a[^>]*>(.*?)<\/a>/is" , "$1" , $info['content']);
        if ($info['pid']) {
			$return['auction'] = pdo_get('jy_jdpm_auction',array('pid' => $info['pid']));
        }
        if ($info['mid'] == $uid) {
            $heid = $info['sendid'];
        } else {
            $heid = $uid;
        }
        if ($heid == 0) {
            if ($info['aid'] == 0) {
                $guest = array('nickname' => '系统' , 'avatar' => '');
                $list  =  pdo_get('jy_jdpm_mysms',array('mid' => $uid , 'id' => $sid));
            }
        } else {
            $guest       = pdo_get('jy_jdpm_mysms',array('mid' => $heid));
            $return['guest']=$guest;
            // 会话列表
            $list  =  pdo_get('jy_jdpm_mysms',array('mid' => $uid , 'id' => $sid));
        }

$myinfo       =  pdo_get('jy_jdpm_member',array('mid' => $uid),array('mid','account','nickname','avatar'));

$return['myinfo']=$myinfo;
$return['info']=$info;
$return['list']=$list;
set_html('title','会员中心');
exi($return);